package com.metadata_system.common.db.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@Table(name = "md_user")
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
public class User {
    @Id
    private Integer id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 所属角色
     */
    private String role;

    /**
     * 状态: 0.已停用 1.启用中  2.登录锁定
     */
    private Integer status;


    /**
     * 附加参数
     */
    private Integer params;

    /**
     * 是否有逻辑工具访问权限：0.否 1.是
     */
    @Column(name = "is_logic_tool_access")
    private Integer isLogicToolAccess;


    /**
     * 未读消息-总数
     */
    @Column(name = "un_read_message_total")
    private Integer unReadMessageTotal;

    /**
     * 运行中-队列-总数
     */
    @Column(name = "running_queue_total")
    private Integer runningQueueTotal;


    /**
     * 解锁登录限制时间
     */
    @Column(name = "un_lock_login_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date unLockLoginTime;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;
}
